<template>
  <div class="safetyWrap">
    <div class="form-section broadcast">
      <div class="form-item form-item-style1">
        <div class="label-title">
          <label class="lookmsg">通知公告</label>
        </div>
        <div class="right-select" @click="addBroadcast">
          <p>新增&nbsp;&nbsp;</p>
          <i class="iconfont icon-zengjia"></i>
        </div>
      </div>
    </div>
    <div class="safetyBox">
      <noData v-if="listAllCount == 0"></noData>
      <group>
        <cell
          :title="(item.Title)"
          :border-intent="true"
          class="safetyCell"
          v-for="(item,index) in cellList"
          :key="index"
          is-link
          value-align="left"
          @click.native="getBroadcast(item)"
        >
          <span class="safetydate">{{item.IssueTime}}</span>
        </cell>
      </group>
    </div>
    <myMenu></myMenu>
  </div>
</template>
<script>
import myMenu from "@/commonComponents/menu";
export default {
  name: "safetyScore",
  components: {
    myMenu
  },
  data() {
    return {
      userInfo: {}, //用户信息
      listAllCount: 0, //总数
      cellList: [
        {
          CheckDate: "2019-08-22"
        }
      ] //安全检查评分列表
    };
  },
  created() {
    this.$vux.loading.show({
      text: "Loading"
    });
    this.userInfo = JSON.parse(localStorage.getItem("userInfo"));
    this.getData();
  },
  methods: {
    getData() {
      var that = this;
      var params = {
        allowPaging: true,
        business: "GetAffiche",
        pageIndex: 0,
        pageSize: 20,
        tokenId: "",
        data: {
          isImportant: ""
        },
        userId: this.userInfo.userid
      };

      this.$axiosAjax
        .getConfigJson(params)
        .then(res => {
          if (res.data.code == 0) {
            that.cellList = res.data.data.result;
            that.listAllCount = res.data.count;
          } else {
            this.$vux.toast.text(res.data.info);
          }
        })
        .catch(() => {})
        .finally(() => {
          this.$vux.loading.hide();
        });
    },
    //查看详情
    checkMore(item) {
      this.$router.push({
        path: "/broadcastDetail",
        query: { CheckWorkId: item.ID }
      });
    },
    addBroadcast() {
      this.$router.push({
        path: "/broadcastDetail"
      });
    },
    getBroadcast(item) {
      this.$router.push({
        path: "/broadcastDetail",
        query: {
          operate: "edit",
          id: item.ID
        }
      });
    }
  }
};
</script>
<style scoped>
.safetyWrap {
  background: #ebeef2;
}
.safetyBox {
  background: #fff;
  border-radius: 10px;
  /* padding: 0 20px; */
}
.safetyTit {
  height: 40px;
  line-height: 40px;
  color: #2269ff;
  text-align: right;
  padding-right: 20px;
  margin-left: 20px;
  font-size: 12px;
  /* border-bottom: 1px solid #d9d9d9; */
}
.safetyCell {
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 13px;
}
.safetydate {
  float: right;
  height: 55px;
  line-height: 55px;
  color: #666;
}
.right-select {
  display: flex;
  justify-content: flex-end;
  font-size: 13px;
  color: #999;
  height: 20px;
  width: 180px;
  position: relative;
  padding-right: 20px;
  line-height: 20px;
}
.right-select p {
  width: 130px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
</style>
<style>
.broadcast {
  /* background-color: #ebeef2; */
}
.broadcast .icon-zengjia {
  position: absolute;
  right: 0px;
  color: #15bd84;
  font-size: 22px;
}
.safetyBox .weui-cells {
  margin-top: 0;
}
.safetyBox .vux-no-group-title {
  margin-top: 0;
}
.safetyBox .weui-cells:before,
.safetyBox .weui-cells:after {
  display: none;
}
.safetyBox .safetyCell:last-child::after {
  content: " ";
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  height: 1px;
  border-top: 1px solid #d9d9d9;
  color: #d9d9d9;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transform: scaleY(0.5);
  transform: scaleY(0.5);
  left: 4vw;
}
</style>
